﻿using Model;
using Model.BusinessModel;
using Model.BusinessModel.InPut;
using Model.BusinessModel.MatchFormula;
using Model.BusinessModel.OutPut;
using Model.BusinessModel.OutPut.sys;
using Model.DomainModel.Sys;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Utility;

namespace DomainService.IService.Sys
{
    /// <summary>
    /// 数据规则服务接口
    /// </summary>
    public interface ISysDataRuleService
    {
        /// <summary>
        /// 新增规则数据
        /// </summary>
        /// <param name="sysDataRule">数据规则数据</param>
        /// <param name="loginUserMsg">登录人员信息</param>
        ReceiveStatus Insert(SysDataRuleInput sysDataRule, LoginOutPut loginUserMsg);

        /// <summary>
        /// 修改规则数据
        /// </summary>
        /// <param name="sysDataRule">数据规则数据</param>
        /// <param name="loginUserMsg">登录人员信息</param>
        ReceiveStatus Update(SysDataRuleInput sysDataRule, LoginOutPut loginUserMsg);

        /// <summary>
        /// 设置规则是否启用
        /// 同一个菜单、同一个规则类型，只能启用一个规则
        /// </summary>
        /// <param name="ruleId">规则主键</param>
        /// <param name="menuId">菜单id</param>
        /// <param name="isOpen">是否打开</param>
        /// <param name="rowAuthType">行权限类型</param>
        ReceiveStatus SetRuleIsOpenById(string? ruleId, string? menuId, bool isOpen, int rowAuthType);

        /// <summary>
        /// 获取菜单数据规则数据
        /// </summary>
        /// <param name="menuId">菜单ID</param>
        /// <param name="ruleType">规则类型</param>
        /// <returns>返回规则数据</returns>
        ReceiveStatus<SysDataRuleOutPut> GetMenuDataRuleList(string menuId, int ruleType);

        /// <summary>
        ///  获取数据规则
        /// </summary>
        /// <param name="pageResultModel">分页模型</param>
        /// <returns>返回规则数据</returns>
        PageResultModel<SysDataRuleOutPut> GetDataRuleList(PageResultModel pageResultModel);

        /// <summary>
        /// 获取当前规则使用按钮
        /// </summary>
        /// <param name="ruleId"></param>
        /// <returns></returns>
        ReceiveStatus<string> GetUseDataRuleButton(string ruleId);

        /// <summary>
        /// 获取数据权限配置
        /// </summary>
        /// <param name="menuId">菜单id</param>
        /// <param name="configType">配置类型</param>
        /// <returns></returns>
        ReceiveStatus<MatchFormulaDataSourceOutPut> GetDataRuleConfig(string menuId, int configType);
    }
}
